#pragma once

#include "GamePart.h"
#include "DataAccesser.h"
#include "GVint.h"



namespace _DATAPARTFACTORY_
{
	namespace _GAME_
	{
		class ActorFactory:
			public GamePartFactory,
			public ::_FOGGE_::_GDB_::DataAccesser	
		{
		public:
			ActorFactory(void);
			~ActorFactory(void);

			_FOGGE_::_GDB_::aDataPartBase* LoadPart(TiXmlNode* ptrNode);
			
			_FOGGE_::_GDB_::aDataPartBase* CreatePart();

	
		};
	}
}
	


namespace _DATAPART_
{
	namespace _GAME_
	{

		enum eGameActorType
		{
			eGAT_World=0,
			eGAT_Player,
			eGAT_Rock,
			eGAT_Count=32//!<actor type limit

		};
		class Actor:
			public GamePart
		{
			FoDeclareRTTI;
			friend _DATAPARTFACTORY_::_GAME_::ActorFactory;
		public:
			Actor(void);
			~Actor(void);


			
			Weapon* GetPrimaryWeapon()
			{
				return m_ptrPrimaryWeapon;
			}
			Weapon* GetSecondaryWeapon()
			{
				return m_ptrSecondaryWeapon;
			}
			const Hull* GetHull()
			{
				return m_ptrHull;
			}
			const Engine* GetEngine()
			{
				return m_ptrEngine;
			}
			const Function* GetFunction()
			{
				return m_ptrFunction;
			}
			
			

		protected:

			Weapon* m_ptrPrimaryWeapon;
			Weapon* m_ptrSecondaryWeapon;
			Hull* m_ptrHull;
			Shield* m_ptrShield;
			Engine* m_ptrEngine;
			Function* m_ptrFunction;

			_FO_GDB::GVint m_gviHealth;


			virtual void AfterCreate();

			void CopyFrom(aDataPartBase* ptrSource);
		};
	}
}
